<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?php echo C('SITE_INFO.name');?></title>
<script type="text/javascript" src="__PUBLIC__/scripts/jquery-1.7.2.min.js"></script>
<link href="__PUBLIC__/Catalog/css/common.css" rel="stylesheet" type="text/css" />

<link href="__PUBLIC__/Catalog/css/sendGoods.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="__PUBLIC__/scripts/ui/redmond/jquery-ui-1.8.6.css">        
<script type="text/javascript" src="__PUBLIC__/scripts/ui/jquery-ui-1.8.6.min.js"></script>
<script src="__PUBLIC__/Static/Uploadify/jquery.uploadify-3.1.min.js"></script>
<link href="__PUBLIC__/Static/Uploadify/uploadify.css" rel="stylesheet">
<link rel="stylesheet" href="__PUBLIC__/js/treeview/jquery.treeview.css" />
<script src="__PUBLIC__/js/treeview/jquery.cookie.js"></script>
<script src="__PUBLIC__/js/treeview/jquery.treeview.js"></script>
<style>
.imagelist{}
.imagelist li{
    display: inline;
    float: left;
	margin-right:10px;
    width: 80px;
	height:60px;
	overflow:hidden;
	position: relative;
	
}
.imagelist li em{
    color: #999999;
    display: block;
    line-height: 18px;
    padding: 8px 0px;
}

.imagelist li span.txt {
	display:none;
    line-height:25px;
	height:25px;
    width: 80px;
	text-align:right;
	position:absolute;
	top:0px;
	right:0px;
}
.uploadify {
    position: absolute;
    margin-bottom: 1em;
    right: 10px;
</style>
<script>
$(function() {
    $( "#datepicker" ).datepicker({dateFormat: "yy-mm-dd"});	
    $( "#sub_tabs" ).tabs();  
});
$(function(){
	$("#browser").treeview({			
		  animated: "medium",
		});	

	$("#image_result").sortable();
	$('.imagelist li').live({
	   mouseenter:
	   function()
	   {
		  $(this).find('.txt').css('display','block');
	   },
	   mouseleave:
	   function()
	   {
		  $(this).find('.txt').css('display','none');
	   }
	});
	$("#upload").uploadify({
		height        : 60,
		swf           : '__PUBLIC__/Static/Uploadify/uploadify.swf',
		uploader      : '<?php echo U("Uploadify/upload");?>',
		width         : 80,
		buttonText	  : '<img width="80" height="60" src="__PUBLIC__/Catalog/images/kaadd.png" />',
		auto		  : true,
		removeCompleted: false,
		onUploadSuccess: function(file, data, response) {
			//$('#progress').hide();
			var result = $.parseJSON(data);
			//错误处理。。。
			if(!data){alert(file.name+'上传失败'); return false;}
			if(result.status == 0){
				alert(file.name+result.message);
				return false;
			}
			//上传成功
			var id = Math.random().toString();
			id = id.replace('.','_'); //生成唯一标示
			var html = '<li class="imageitem" id="'+id+'">';
				html+= '<input type="hidden" name="file[]" value="'+result.file_name+'">'; //隐藏域，是为了把图片地址入库。。
				html+=  '<span class="txt">';
				html+=  '<a title="del" href=javascript:remove("'+result.file_name+'","'+id+'");><img src="__PUBLIC__/Static/Uploadify/remove.png" /></a>';
				html+=  '</span>';
				html+= '<img height="60" width="80" src="'+result.file+'" />';
				html+=  '</li>';
			$('#image_result').append(html);
		},
		/*  onUploadStart: function(){
			$('#progress').empty().append('<img src="__PUBLIC__/images/load.gif">');  //用户等待提示。
			$('#progress').show();
		},*/
		onInit: function (){  
			$("#upload-queue").hide(); //隐藏上传队列                
		}		 
	});
})
function remove(file,id){
	$.getJSON('<?php echo U("removeImg");?>',{file:file},function(data){$('#'+id).remove()})
}

</script>
<style>
.zh {
    width: 100%;
    min-height: 545px;
    background: #FFF none repeat scroll 0% 0%;
    margin: 5px auto 0px;
    font-size: 13px;
    font-family: "黑体";
    padding-left: 10px;
}
.dds1 {
    width: 90%;
    min-height: 40px;
    font-size: 13px;
    font-family: "黑体";
    line-height:150%;
    padding-bottom:10px;
}
.dds {
    width: 90%;
    min-height: 40px;
    font-size: 13px;
    font-family: "黑体";
    line-height:150%
}
.dds input {
    width: 80%;
    height: 22px;
    font-size: 13px;
    font-family: "黑体";
    border: 1px solid #CCC;
    border-radius: 8px;
}
.ka {
    width: 90%;
    height: 145px;
    margin: 5px auto 0px;
    text-align: center;
    line-height: 107px;
    color: #FFF;
    font-family: "黑体";
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
    position: relative;
    font-size: 13px;
    background: transparent url("__PUBLIC__/Catalog/images/otherimage.jpg") no-repeat scroll 0% 0% / 330px 156px;
}
</style>
</head>
<body>
<div class="main">
   <form action="<?php echo U('Other/index');?>" id="otherForm" method="post">
	   <div class="jiaoyi">
	       <div class="ka">
	           <div class="imglist">
	           		<!-- <ul class="imagelist" id="image_result">
                    </ul>
	               <span style="display:block;float:right;width:80px;"  class="ka1" id="upload"></span> -->
	               <!--  <span class="ka1"><img src="__PUBLIC__/Catalog/images/kaimg01.png" /></span>
	                <span class="ka2"><img src="__PUBLIC__/Catalog/images/kaimg02.png" /></span>
	                <span class="kaadd"></span> -->
	           </div>
	       	  
	       </div>
	       <div class="zh">
	       	    <dl>
	       	    	<dd class="dds1">	<?php echo ($imgdes); ?></dd>
	       	   </dl>
	           <dl>
	              <dd class="dds">姓名:<input type="text" name="name" value="" placeholder="姓名" required/></dd>
	           </dl>
	           <dl>
	              <dd class="dds">电话:<input type="tel" id="tel" name="tel" value="" placeholder="电话" required/></dd>
	           </dl>
	          <dl>
	           <dt style="height:20px;"> 所在区域:</dt>
	           <dd>
	               <?php echo W('Shiqu',array('now_city_id'=>$nowCityProvince['code'],'now_area_id'=>''));?>
	           </dd>
	          </dl>
	          <br/>
	           <dl>
	              <dt style="height:20px;">详细地址:</dt>
	              <dd class="dds" style="height:100px;"><textarea rows="3" cols="10" name="address" style="width:100%;border:1px solid #cecece" ></textarea></dd>
	          </dl>
	            <dl>
	                    <dd class="dds">衣服:<input style="width:60px;border:1px solid #cecece" type="number" name="clothes_num" />件</dd>
	            </dl>
	             <dl>
	                    <dd class="dds">书籍:<input style="width:60px;border:1px solid #cecece" type="number" name="book_num" />件</dd>
	             </dl>
	             <dl>
	                    <dd class="dds">其他:<input style="width:60px;border:1px solid #cecece" type="number" name="other_num" />件</dd>
	             </dl>
	             <dl>
	                 	<dd class="dds"><input type="button" id="tijiao" value="提交" /></dd>
	            </dl>
	       </div>
	   </div>
	   
 		
</div>

  </form>
<script>
    $(function(){
        if('<?php echo ($msg); ?>'!='0'){
            alert('<?php echo ($msg); ?>');
        }
    });
    
    $('#tijiao').bind("click",function(){
    	
    	var tel = $('#tel').val();
    	
    	//var reg = /^d+(.d+)?$/;
    	//alert(isNaN(tel));
    	if(isNaN(tel)){
    			alert('电话号码输入错误！');
    			return false;
    	}else{
    			$('#otherForm').submit();
    		}
    	
    	
    	
    });
    
</script>